# class Animal:
#     name = 'animal'
#
#     def shout(self):
#         print('animal shout')
#
# animal = Animal()
# print(animal.name)
# animal.shout()

class Dog:
    name = 'dog'
    def __init__(self):
        self.age = 20
    def eat(self):
        print('eat dog'.split(" ").reverse())

print('-'*10)
dog1 = Dog()
print(dog1.name)
print(Dog.name)
print('-'*10)
dog1.name = 'a254'
print(dog1.name)
print(Dog.name)
print('-'*10)
# 类属性只能通过类修改
Dog.name = 'bbbbb'
print(dog1.name)
print(Dog.name)
print('-'*10)

dog2 = Dog()
dog2.eat()
print(dog2.age)